Text = "text1 has the tabindex 1 and you're able to write in this control."
Top = 240
Width = 6972
End
Begin CommandButton Command1
Caption = "end"
Height = 492
Left = 840
TabIndex = 0
Top = 720
Width = 1332
End
Begin Label Label1
BackColor = &H00C0C0C0&
Caption = "this demo shows how to disable task-switching or termination of an VB -appl. via keyboard. please try 'ctl' + 'esc' , 'alt' + 'tab' or 'alt' + 'F4'"
Height = 492
Left = 1320
TabIndex = 2
Top = 1560
Width = 8532
End
End
Declare Function getactivewindow Lib "User" () As Integer
Declare Function SetFocusAPI Lib "User" Alias "SetFocus" (ByVal hWnd As Integer) As Integer
Declare Function SetSysModalWindow Lib "User" (ByVal hWnd As Integer) As Integer
Declare Function LockInput Lib "User" (ByVal hReserved As Integer, ByVal hwndInput As Integer, ByVal fLock As Integer) As Integer
Dim vwnd As Integer
' thomas hengelhaupt
' comp-serve id 100120,115
Sub Command1_Click ()
x = LockInput(0, vwnd, 0)
End
End Sub
Sub Form_KeyDown (keycode As Integer, Shift As Integer)
Select Case keycode
Case 0 To 20
keycode = 0
Case 100 To 255
keycode = 0
End Select
End Sub
Sub Form_Load ()
Show
DoEvents
vwnd = getactivewindow()
Dim x As Integer
x = SetFocusAPI(vwnd)
x = SetSysModalWindow(vwnd)
x = LockInput(0, vwnd, 1)
End Sub
Sub Form_Unload (Cancel As Integer)
x = LockInput(0, vwnd, 0)
End Sub
Sub List1_Click ()
End Sub
Sub List1_DragOver (Source As Control, x As Single, Y As Single, state As Integer)
End Sub
Sub List1_KeyDown (keycode As Integer, Shift As Integer)
If keycode = 27 Then
Unload form1
Load form1
form1.Show
End If
End Sub
Sub List1_MouseDown (button As Integer, Shift As Integer, x As Single, Y As Single)